home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / e_os300b / ex_vesa2 / exampl16.asm next >
Encoding:
Assembly Source File  |  1996-11-06  |  2.4 KB  |  68 lines

  1. ;╔══════════════════════════════════════════════════════════════════════════╗
  2. ;║                                                                          ║
  3. ;║ This example show how to use the Linear Framebuffer with VESA 2.0        ║
  4. ;║                                                                          ║
  5. ;║                                                                          ║
  6. ;║                                                                          ║
  7. ;║ Tabs : 13 21 29 37                                                       ║
  8. ;║                                                                          ║
  9. ;╚══════════════════════════════════════════════════════════════════════════╝
  10.  
  11. Locals
  12. .386
  13. CODE32 SEGMENT PUBLIC PARA 'CODE' USE32
  14. ASSUME  CS:CODE32,DS:CODE32,ES:CODE32
  15.  
  16. INCLUDE ..\RESOURCE\EOS.INC
  17.  
  18. File_Pic1   db '..\data\test640.DLZ',0
  19. Addr_Pic    dd 0
  20.  
  21. Buffer      dd ?
  22.  
  23. Vesa_Txt    db '    ■ Mode SVGA not supported or VESA not found !',13,10
  24.             db '      To install a vesa driver, refer to your video card documentation.',13,10,36
  25.  
  26. Start32:
  27.             mov ah,Load_Internal_File
  28.             mov edx,O File_Pic1
  29.             Int_EOS                 ; Load the file even if the program isn't
  30.             mov [Addr_Pic],eax      ; Link + Internal Check if the File is present
  31.  
  32.             mov eax,Mode640x480x256 ; Init SVGA Mode
  33.             mov ecx,640*480         ; Linear Buffer Size
  34.             call Init_Vesa2
  35.             jc Error_Vesa
  36.             mov [Buffer],eax        ; Linear Buffer Address
  37.  
  38.             mov esi,[Addr_Pic]      ; Set palette
  39.             add esi,10              ; Header offset of SCX
  40.             mov dx,3c8h
  41.             xor al,al
  42.             out dx,al
  43.             mov ecx,256*3
  44.             inc dl
  45.             cli
  46. @@again:    outsb                   ; rep outsb do not work with all cards
  47.             loop @@again
  48.             sti
  49.  
  50.             mov edi,[Buffer]
  51.             mov ecx,(640/4)*480
  52.             rep movsd
  53.  
  54.             xor ah,ah               ; Wait a key
  55.             DosInt 16h
  56.  
  57.             mov ax,4c00h
  58.             int 21h                 ; Exit with Error Code 0
  59.                                     ; and Automaticly restore video Mode !!!
  60.  
  61. Error_Vesa:
  62.             mov edx,offset Vesa_Txt
  63.             mov ah,Exit_Error
  64.             Int_EOS
  65.  
  66.             CODE32 ENDS
  67.  
  68.             END